package org.e_gold.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.e_gold.util.Bet365;

@Entity
@Table(name = "event")
public class Event extends ValueObject implements Serializable, Bet365 {

    public static final String NAME = "name";

    private static final long serialVersionUID = 1L;

    private String name;

    @Id
    @GeneratedValue
    private Long id;

    @Column(name = "home_name")
    private String homeName;

    @Column(name = "away_name")
    private String awayName;

    @Column(name = "total_goal")
    private Integer totalGoal;

    private String location;

    @Column(name = "play_time")
    private Integer playTime;

    @Column(name = "location_full")
    private String locationFull;

    @OneToMany
    private Set<Contract> contracts = new HashSet<Contract>(0);

    public Integer getPlayTime() {

        return playTime;
    }

    public void setPlayTime(Integer playTime) {

        this.playTime = playTime;
    }

    public String getLocation() {

        return BASE_SPORT + location.substring(3);
    }

    public void setLocation(String location) {

        this.location = location;
    }

    public String getLocationFull() {

        return locationFull;
    }

    public void setLocationFull(String locationFull) {

        this.locationFull = locationFull;
    }

    public Long getId() {

        return id;
    }

    public void setId(Long id) {

        this.id = id;
    }

    public String getHomeName() {

        return homeName;
    }

    public void setHomeName(String homeName) {

        this.homeName = homeName;
    }

    public String getAwayName() {

        return awayName;
    }

    public void setAwayName(String awayName) {

        this.awayName = awayName;
    }

    public Integer getTotalGoal() {

        return totalGoal;
    }

    public void setTotalGoal(Integer totalGoal) {

        this.totalGoal = totalGoal;
    }

    public String getName() {

        return name;
    }

    public void setName(String name) {

        this.name = name;
    }

    public Set<Contract> getContracts() {

        return contracts;
    }

    public void setContracts(Set<Contract> contracts) {

        this.contracts = contracts;
    }

}
